Class Vector {Java}

Documentation

* The <code>Vector</code> class implements a growable array of
* objects. Like an array, it contains components that can be
* accessed using an integer index. However, the size of a
* <code>Vector</code> can grow or shrink as needed to accommodate
* adding and removing items after the <code>Vector</code> has been created.
* <p>
* Each vector tries to optimize storage management by maintaining a
* <code>capacity</code> and a <code>capacityIncrement</code>. The
* <code>capacity</code> is always at least as large as the vector
* size; it is usually larger because as components are added to the
* vector, the vector's storage increases in chunks the size of
* <code>capacityIncrement</code>. An application can increase the
* capacity of a vector before inserting a large number of
* components; this reduces the amount of incremental reallocation.
*
* @author Lee Boynton
* @author Jonathan Payne
* @version 1.36, 01/28/97
* @since JDK1.0


Parent Packagejava.utilAbstractNo
Export ControlPublicAccessLink Class forNone
Class KindNormalClassCardinalityn
Space ConcurrencySequential
PersistenceNo


Operations
NameSignatureClass
Vector Vector (int initialCapacity, int capacityIncrement)Vector
Vector Vector (int initialCapacity)Vector
Vector Vector ()Vector
copyIntovoid copyInto (Object anArray[])Vector
trimToSizevoid trimToSize ()Vector
ensureCapacityvoid ensureCapacity (int minCapacity)Vector
setSizevoid setSize (int newSize)Vector
capacityint capacity ()Vector
sizeint size ()Vector
isEmptyboolean isEmpty ()Vector
elementsEnumeration elements ()Vector
containsboolean contains (Object elem)Vector
indexOfint indexOf (Object elem)Vector
indexOfint indexOf (Object elem, int index)Vector
lastIndexOfint lastIndexOf (Object elem)Vector
lastIndexOfint lastIndexOf (Object elem, int index)Vector
elementAtObject elementAt (int index)Vector
firstElementObject firstElement ()Vector
lastElementObject lastElement ()Vector
setElementAtvoid setElementAt (Object obj, int index)Vector
removeElementAtvoid removeElementAt (int index)Vector
insertElementAtvoid insertElementAt (Object obj, int index)Vector
addElementvoid addElement (Object obj)Vector
removeElementboolean removeElement (Object obj)Vector
removeAllElementsvoid removeAllElements ()Vector
cloneObject clone ()Vector
toStringString toString ()Vector


Attributes
NameClassTypeInitial Value
elementCountVectorint
capacityIncrementVectorint
serialVersionUIDVectorlong- 2767605614048989439L


Realize Relationships
NameClassSupplier
--Not Named--Vector
--Not Named--Vector


ObjectscourseList:Vector



Property Settings

Java
GenerateFinalizerFalseGenerateStaticInitializerFalse
GenerateInstanceInitializerFalseGenerateDefaultConstructorFalse
FinalFalseConstructorIspublic
Ctor_Setpublic, protected, private, packageStaticFalse